package kr.co.shoppingmall.noticeboard;

import java.util.HashMap;
import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class NoticeBoardDAOImpl extends SqlMapClientDaoSupport implements
		NoticeBoardDAO {

	@Override
	public void insertNoticeBoard(NoticeBoardDTO dto) {
		getSqlMapClientTemplate().insert("insertNoticeBoard", dto);
	}

	@Override
	public List getNoticeBoardList(HashMap map) {
		return getSqlMapClientTemplate().queryForList("getNoticeBoardList", map);
	}

	@Override
	public int getCount() {
		return (int) getSqlMapClientTemplate().queryForObject("getNoticeCount");
	}

	@Override
	public NoticeBoardDTO getNoticeBoard(int nboard_num) {
		return (NoticeBoardDTO)getSqlMapClientTemplate().queryForObject("getNoticeBoard", nboard_num);
	}

	@Override
	public void updateNoticeBoardHit(int nboard_num) {
		getSqlMapClientTemplate().queryForObject("updateNoticeBoardHit", nboard_num);
	}

	@Override
	public void deleteNoticeBoard(NoticeBoardDTO dto) {
		getSqlMapClientTemplate().delete("deleteNoticeBoard", dto);
	}

}
